<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>客户管理中心</title>
	<script src="../js/jquery3.js"></script>
	<link rel="stylesheet" type="text/css" href="../layui/css/layui.css" />
	<link rel="stylesheet" type="text/css" href="../css/index_icon2.css" />
	<style type="text/css">
		.layui-side-scroll {
			width: 0px;
		}

		body {
			overflow-y: auto;
		}

		.layui-body {
			overflow-y: auto;
		}
	</style>
</head>

<body class="layui-layout-body">
	<div class="layui-layout">
		<div class="layui-header" style="height: 60px;">
			<!-- <div ></div> -->
			<!-- 头部区域（可配合layui已有的水平导航） -->
			<ul class="layui-nav">
				<li class="layui-logo layui-nav-item" style="margin-left: 40px;">
					<img src="../img/team.png" style="width: 40px;">
					<b style="font-size: 20px; margin-left: 10px">客户管理中心</b>
				</li>
				<li class="layui-nav-item" style="margin-left: 150px;">
					<a href="" style="font-size: 18px">
						<i class="iconfont icon-0-03" style="font-size: 30px;"></i>首页</a>
				</li>
				<li class="layui-nav-item">
					<a href="javascript:;" data-index="/html/customer/customer_management.html" style="font-size: 18px">
						<i class="iconfont icon-0-47" style="font-size: 25px;"></i>客户管理</a>
				</li>
				<li class="layui-nav-item">
					<a href="javascript:;" data-index="/html/sales/sales_management.html" style="font-size: 18px">
						<i class="iconfont icon-0-27" style="font-size: 30px;"></i>销售管理</a>
				</li>
				<li class="layui-nav-item">
					<a href="javascript:;" data-index="/html/contact/contact_management.html" style="font-size: 18px">
						<i class="iconfont icon-0-08" style="font-size: 30px;"></i>联系人管理</a>
				</li>
				<li class="layui-nav-item">
					<a href="javascript:;" data-index="/html/time/time_management.html" style="font-size: 18px"><i
							class="iconfont icon-0-41" style="font-size: 30px;"></i>时间管理</a>
				</li>
			</ul>
			<ul class="layui-nav layui-layout-right">
				<li class="layui-nav-item">
					<a href="javascript:;">
						<img src="" id="picture" class="layui-nav-img">
						<span id="username"></span>
					</a>
					<dl class="layui-nav-child">
						<dd><a href="javascript:;" id="upload">修改头像</a></dd>
					</dl>
				</li>
				<li class="layui-nav-item layui-icon"><a href="/user/exit" style="width: 20px">&#xe682;</a></li>
			</ul>
		</div>
		<div class="layui-body" style="position:absolute; left: -200px;">
			<!-- 内容主体区域 -->
			<div class="layui-body" id="LAY_app_body">
				<div class="layadmin-tabsbody-item layui-show" style="height: 100%; margin-top: 60px;">
					<iframe src="./index/index_1.html" frameborder="0" class="layadmin-iframe"
						style="width: 100%;height: 100%;"></iframe>
				</div>
			</div>
		</div>
	</div>
	<script src="../layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script>

		$.post("/user/getImg", {}, function (res) {
			$("#picture")[0].src = "../img/" + res
		})

		$.ajax({
			url: "/user/getSelf",
			success: function (data) {
				if (data.u_id != 0) {
					var username = data.u_name;
					$("#username").text(username);

				} else {
					alert("未登录，请先登录")
					location.href = "./html/login/login.html"
				}
			}
		})

		//JavaScript代码区域
		layui.use('element', function () {
			var element = layui.element;
			$(".layui-header a").each(function (index, el) {
				$(el).click(function () {
					$(".layui-body iframe").attr("src", $(this).attr("data-index"))
				})
			})
		});
		layui.use('layer', function () {
			var layer = layui.layer;
			$("#upload").click(function () {
				layer.open({
					type: 2,
					title: '修改头像',
					shadeClose: true,
					shade: 0.2,
					area: ['300px', '50%'],
					shadeClose: false,
					content: './login/update_img.html',
					end: function () {
						window.parent.location.reload(); //刷新父页面
					}
				})
			})
		})
	</script>
</body>

</html>